package com.bingxue.edu.common.job;

import com.bingxue.edu.framework.job.DynamicJob;
import com.bingxue.edu.management.education.service.ClassStatService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.JobExecutionContext;
import org.springframework.scheduling.quartz.QuartzJobBean;

/**
 * @author panbo
 * @since 2024/8/26
 */
@Slf4j
@DisallowConcurrentExecution
@RequiredArgsConstructor
@DynamicJob(name="班级统计数据计算任务", cron = "0 0 0/1 * * ? ", paramClass = DemoJobParam.class)
public class ClassStatComputeJob extends QuartzJobBean {

    private final ClassStatService classStatService;

    @Override
    protected void executeInternal(JobExecutionContext context) {
        log.info("班级统计数据计算开始");
        classStatService.computePerformanceRate();
        log.info("班级统计数据计算结束");
    }
}
